from machine import Pin
import time

infrared = Pin(17, Pin.IN, Pin.PULL_UP)
led = Pin(16, Pin.OUT)


def led_run():
    for _ in range(2):
        led.value(1)
        time.sleep(0.5)
        led.value(0)
        time.sleep(0.5)
        
        
    
if __name__ == "__main__":
    
    led.value(0);
    
    while True:
        if infrared.value() == 0:
            led_run()

